@echo off
chcp 65001 >nul
echo ========================================
echo ChatTTS 0.2.4 一键安装脚本
echo ========================================
echo.

echo [1/3] 正在安装 PyTorch (CPU版本)...
pip install torch torchaudio --index-url https://download.pytorch.org/whl/cpu -i https://pypi.tuna.tsinghua.edu.cn/simple
if errorlevel 1 (
    echo ❌ PyTorch 安装失败!
    pause
    exit /b 1
)
echo ✓ PyTorch 安装成功!
echo.

echo [2/3] 正在安装 ChatTTS 0.2.4 及依赖...
pip install ChatTTS==0.2.4 omegaconf vocos -i https://pypi.tuna.tsinghua.edu.cn/simple
if errorlevel 1 (
    echo ❌ ChatTTS 安装失败!
    pause
    exit /b 1
)
echo ✓ ChatTTS 0.2.4 安装成功!
echo.

echo [3/3] 验证安装...
python -c "import ChatTTS; print('✓ ChatTTS 验证成功! 版本:', ChatTTS.__version__ if hasattr(ChatTTS, '__version__') else '0.2.4')"
if errorlevel 1 (
    echo ❌ ChatTTS 验证失败!
    pause
    exit /b 1
)
echo.

echo ========================================
echo ✅ ChatTTS 0.2.4 安装完成!
echo ========================================
echo.
echo 接下来:
echo 1. 首次运行会下载模型(约2GB,陙10-20分钟)
echo 2. 运行: python main.py
echo 3. 查看文档: ChatTTS本地部署指南.md
echo.
pause
